export const formatDateHms = (date: string) => {
    const nDate = new Date(date)
    const hour = nDate.getHours().toString().padStart(2, '0')
    const minute = nDate.getMinutes().toString().padStart(2, '0')
    const ss = nDate.getSeconds().toString().padStart(2, '0')
    return hour + ':' + minute + ':' + ss
}

export const getNowTime = () => {
    const nDate = new Date()
    const year = nDate.getFullYear()
    const month = (nDate.getMonth() + 1).toString().padStart(2, '0')
    const day = nDate.getDate().toString().padStart(2, '0')
    const hour = nDate.getHours().toString().padStart(2, '0')
    const minute = nDate.getMinutes().toString().padStart(2, '0')
    const ss = nDate.getSeconds().toString().padStart(2, '0')
    return year + '-' + month + '-' + day + ' ' + hour + ':' + minute + ':' + ss
}

export const getNowTimeText = () => {
    const nDate = new Date()
    // console.log(nDate)
    // const year = nDate.getFullYear()
    // const month = (nDate.getMonth() + 1).toString().padStart(2, '0')
    // const day = nDate.getDate().toString().padStart(2, '0')
    const hour = nDate.getHours().toString().padStart(2, '0')
    const minute = nDate.getMinutes().toString().padStart(2, '0')
    const ss = nDate.getSeconds().toString().padStart(2, '0')
    return hour + ':' + minute + ':' + ss
}
